'use strict';

const conn = require('../../libs/Conn');

module.exports = async function (params) {
    let querySql = `SELECT ef.engineering_id,ef.engineering_name,DATE_FORMAT(ef.startDate,'%Y-%m-%d') AS startDate,ef.structure_id,ef.building_id,ef.principal_id,ef.status,rf.region_name,rf.region_id FROM engineering_file ef LEFT JOIN region_file rf ON rf.region_id = ef.region_id WHERE ef.engineering_id = ? AND ef.delete_sign = 1`;
    let rec = await conn(querySql,[params.engineering_id]);
    return {success: true, data: rec[0]};

};